<?php
define('IN_ECS', true);
require(dirname(__FILE__) . '/includes/init.php');
require(ROOT_PATH . 'includes/lib_article.php');
$reqid = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
if($_SESSION['user_type']==0){
	$tree=get_sub_cat($reqid);
}else{
	$tree=get_sub_cat($reqid,$_SESSION['admin_name']);
}
$echostr="[";
if($tree){
	foreach ($tree AS $row){
		$echostr .= json_encode($row) . ",";
	}
	$echostr = substr($echostr,0,strlen($echostr)-1);
}
$echostr .= "]";
echo $echostr;
?>